IF NOT EXISTS
(
	SELECT *
	FROM dbo.[sysobjects]
	WHERE [id] = OBJECT_ID(N'dbo.[Example.PrimaryKey]') AND OBJECTPROPERTY([id], N'IsPrimaryKey') = 1
)
	BEGIN
	ALTER TABLE dbo.[ExampleTable] WITH NOCHECK ADD CONSTRAINT [Example.PrimaryKey] PRIMARY KEY CLUSTERED ([Id])
	END
GO